package parameter.crop;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

import dao.MyDAO;

public class SoilWxp {
	SoilWxp(){
		
	}
	private static ArrayList soilWxp_X = new ArrayList() ;
	private static ArrayList soilWxp_Y = new ArrayList() ;
	public static ArrayList getSoilWxp_X() throws SQLException {
		soilWxp_X = new ArrayList();
		String sql = "select * from SoilWxp_X;";
		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		try {
			conn = MyDAO.getConnection();
		} catch (Exception e) {
			e.printStackTrace();
		}

		try {
			stmt = conn.createStatement();
		} catch (SQLException e1) {
			e1.printStackTrace();
		}
		try {
			rs = stmt.executeQuery(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		try {
			while(rs.next()) {
				soilWxp_X.add(rs.getString("soilWxp_X"));	
				
			}
		}
		catch (SQLException e) {
			e.printStackTrace();
		}
		rs.close();
		stmt.close();
		conn.close();
		return soilWxp_X;
	}
	public static void setSoilWxp_X(ArrayList soilWxp_X) {
		SoilWxp.soilWxp_Y = soilWxp_Y;
	}
	public static ArrayList getSoilWxp_Y() throws SQLException {
		soilWxp_Y = new ArrayList() ;
		String sql = "select * from SoilWxp_Y;";
		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		try {
			conn = MyDAO.getConnection();
		} catch (Exception e) {
			e.printStackTrace();
		}

		try {
			stmt = conn.createStatement();
		} catch (SQLException e1) {
			e1.printStackTrace();
		}
		try {
			rs = stmt.executeQuery(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		try {
			while(rs.next()) {
				soilWxp_Y.add(rs.getString("soilWxp_Y"));	
				
			}
		}
		catch (SQLException e) {
			e.printStackTrace();
		}
		rs.close();
		stmt.close();
		conn.close();
		return soilWxp_Y;
	}
	public static void setSoilWxp_Y(ArrayList soilWxp_Y) {
		SoilWxp.soilWxp_Y = soilWxp_Y;
	}
	
}
